package com.zfk.transaction.util.enums;

public enum RequestType implements ReqType{

    // for 200XXX
    SUCCESS(200000, "请求成功"),

    // for 400XXX
    ERROR_PARAM(400000, "参数解析异常"), NO_LOGIN(401000, "请先登录"), ERROR_METHOD(400001, "方法异常"),
    USER_NO_EXISTS(401001, "用户不存在"), FORBIDDEN(403000, "无权限访问"), LOGIN_FAIL(415000, "用户名或密码不正确"),
    // for 500XXX
    INTERNAL_SERVER_ERROR(500000, "未知服务错误"), ERROR_CONNECTION_TIME_OUT(500001, "数据库连接超时"),
    POD_EXEC_EXCEPTION(500002, "POD EXEC 异常");
    private int code;
    private String message;

    RequestType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "[Code:" + this.code + "; Message:" + this.message + "]";
    }
}
